﻿@model Aga.GestionDeArchivos.Web.Models.Estanterias.ImprimirModel
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>Imprimir</title>
    <link href="@Url.Content("~/Content/print.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-barcode-2.0.1.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {

            var settings = {
              output:'css',
              bgColor: '#FFFFFF',
              color: '#000000',
              barWidth: 2,
              barHeight: 50,
              moduleSize: 5,
              showHRI: true,
              addQuietZone: false
            };

            @foreach (var e in Model.Estanterias)
            {
                foreach (var u in e.Ubicaciones) {
                    @:$("@(String.Format("#barcode_{0}", u.Id))").barcode("@(String.Format("{0}", u.CodigoBarra.Replace("*", "")))", "code39", settings);     
                }
            }
        });
    </script>
</head>
<body>
    @{
        int i = 0;
        @:<div class="tagContainer">
        foreach (var e in Model.Estanterias)
        {
            foreach (var u in e.Ubicaciones)
            {
                <div class="tag2">
                    <table border="1" cellpadding="0" cellspacing="0" style="border: 2px solid #000"
                        width="100%">
                        <tr>
                            <td style="text-align:right; border-right: 0px solid #FFF;">
                                Caja N&deg;
                            </td>
                            <td style="border-left: 0px solid #FFF;">
                                @u.NumeroCaja
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" class="tdDESC">
                                <b>D</b> @e.Deposito.Numero <b>E</b> @e.Numero <b>S</b> @u.Sector <b>C</b> @u.Cuadrante
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" class="tdVHF">
                                <b>V</b> @u.Vertical <b>H</b> @u.Horizontal <b>F</b> @u.Fondo
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="padding: 3px 0px">
                                <center>
                                    <div id="@(String.Format("barcode_{0}", u.Id))">
                                    </div>
                                </center>
                            </td>
                        </tr>
                    </table>
                </div>
                i++;
                if (i % 6 == 0)
                {
                    @:</div><div class="tagContainer">
                }
            }
        }
        @:</div>
    }
</body>
</html>
